<template>
  <div id="byd-rad" style="width:400px; height:350px;"></div>
</template>

<script>
export default {
  methods: {
    byd() {
      var myChart = this.$echarts.init(document.getElementById('byd-rad'));
      var option = {
        toolbox: {
          show: true,
           feature: {
            dataView: { show: true, readOnly: false },
            restore: { show: true },
            saveAsImage: { show: true, backgroundColor: 'black' }
          },
          iconStyle: {
             borderColor: 'white'
          },
          right: '30px'
        },
        title: {
            // text: "比亚迪宋PLUS DM-i",
            top: 0,
            left: 10,
            textStyle: {
              fontSize: 13,
              color: 'white'
            },
          },
          textStyle: {
            fontSize: 15
          },
          tooltip: {},
          legend: {
            data: ["关键词权重"],
            bottom: 0,
            left: 10,
            textStyle: {
              color: "white"
            }
          },
          radar: {
            indicator: [{
              name: "油耗",
              max: 1,
              color: "#fa897b",
            }, {
              name: "后备箱",
              max: 1,
              color: "orange"
            }, {
              name: "座椅",
              max: 1,
              color: "skyblue"
            }, {
              name: "发动机",
              max: 1,
              color: "yellow"
            }, {
              name: "价格",
              max: 1,
              color: "pink"
            }, {
              name: "空调",
              max: 1,
              color: "gold"
            }]
          },
          series: [{
            type: "radar",
            areaStyle: {
              color: "orange"
            },
            data: [{
              value: [0.64, 0.52, 0.36, 0.32, 0.24, 0.22],
              name: "关键词权重"
            }],
            label: {
              show: true,
              color: 'white'
            }
          }]
        };
      myChart.setOption(option);
    },
  },
  mounted() {
    this.byd()
  },
}
</script>

<style>

</style>